import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/wj.scss' // wj css
import * as echarts from 'echarts'
import Vant from 'vant';
import 'vant/lib/index.css';
import plugins from './plugins' // plugins

import Cookies from 'js-cookie'
//引入vuex
import store from './store'
import { download } from './utils/request'

// 分页组件
import Pagination from './components/Pagination';
// 自定义表格工具组件
import RightToolbar from "./components/RightToolbar"
// 字典标签组件
import DictTag from './components/DictTag'
// 字典数据组件
import DictData from './components/DictData'
// 头部标签组件
import VueMeta from 'vue-meta'

import { resetForm, addDateRange ,selectDictLabel } from "./utils/wj";


import './assets/icons' // icon

// 全局方法挂载
Vue.prototype.addDateRange = addDateRange
Vue.prototype.$echarts = echarts
Vue.prototype.resetForm = resetForm
Vue.prototype.download = download

// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.prototype.selectDictLabel = selectDictLabel

//是否让vue启动生产消息
Vue.config.productionTip = false

Vue.use(Vant);
Vue.use(VueMeta)
Vue.use(plugins)
DictData.install()
// set element-ui default size
Vue.use(ElementUI, {
  size: Cookies.get('size') || 'medium'
})

/* eslint-disable no-new */
const vm = new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})

export default vm;
